// This programs creates displays lanes that appear to be moving

#include<stdlib.h>
#include<curses.h>
#include<string.h>

void drawLanes(int laneSpeed);

int main(void)
{
	 int	maxcol,
		maxrow,
                row=0,
                col=0,
                rowTemp;
        WINDOW *wnd;

        wnd = initscr();        /* start incurses       */

        getmaxyx(wnd, maxrow, maxcol);

        while(TRUE)
        {
                if (row >= maxrow)
                {
                        row = rowTemp;
                        rowTemp-= 2;
                        if (rowTemp >= maxrow)
                        {
                                rowTemp = 0;
                        }

                }

                mvprintw(row, col, "|\n \n|\n");
                row +=3;
                refresh();
        //      usleep(10);
                usleep(110);
        //      usleep(11000);
                //usleep(500000);
        }

	endwin();
}

void drawLanes(int laneSpeed)		//draws moving lanes, speed Depends on laneSpeed varible
{
	  int   maxcol,
                maxrow,
                row=0,
                col=0,
                rowTemp;
        WINDOW *wnd;

        wnd = initscr();        /* start incurses       */

        getmaxyx(wnd, maxrow, maxcol);

        while(TRUE)
        {
                if (row >= maxrow)
                {
                        row = rowTemp;
                        rowTemp-= 2;
                        if (rowTemp >= maxrow)
                        {
                                rowTemp = 0;
                        }

                }

                mvprintw(row, col, "|\n \n|\n");
                row +=3;
                refresh();
        //      usleep(10);
                usleep(110);
        //      usleep(11000);
                //usleep(500000);
        }

}
